package org.sdau.rotten.library.service;

import org.sdau.rotten.library.entity.Book;
import org.sdau.rotten.library.DTO.AppointExecution;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;


import java.io.IOException;
import java.sql.Timestamp;
import java.util.List;

/**
 * 业务接口：站在"使用者"角度设计接口 三个方面：方法定义粒度，参数，返回类型（return 类型/异常）
 */
public interface BookService {
    Boolean readExcel(MultipartFile excel) throws IOException;

    Book getById(long bookId);

    List<Book> getList();

    AppointExecution appoint(long bookId, long studentId);

    boolean addBook(int bookId, String bookName, int bookNum);

    boolean updateBook(int bookId, String bookName, int bookNum);

    boolean returnBook(int bookId,int studentId);

    List<Book> search(String bookName);

    int appointAgain(long bookId, long studentId, Timestamp timestamp);

    List<Book> queryChart(int bookNum);
}
